package com.zs.hydrant.controller;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/test")
public class TestController {
    @PostMapping("/hello")
    public Map<String, Object> hello() {
        Map<String, Object> result = new HashMap<>();
        try {
            result.put("success", true);
            result.put("msg", "操作成功");
            result.put("data", "hello");
            result.put("code", 200);
        } catch (Exception e) {
            e.printStackTrace();
            result.put("success", false);
            result.put("msg", "系统错误：" + e.getMessage());
            result.put("code", 500);
        }
        return result;
    }
}